package org.logMonitor.dao;

import org.logMonitor.entity.Rule;

import java.util.List;

/**
 * Created by lenovo on 2018/1/14.
 */
public interface RuleDao {
    /**
     * 添加Rule
     * @param rule
     * @return
     */
    int addRule(Rule rule);

    /**
     * 通过id得到rule实体
     * @param id
     * @return
     */
    Rule getRuleById(int id);

    /**
     *
     * @param userId
     * @return
     */
    Rule getRuleByUserId(int userId);

    /**
     * 得到所有没有被删除的规则
     * @return
     */
    List<Rule> getAllRule();

    /**
     * 假删除规则
     * @param ruleId
     * @return
     */
    int deleteRule(int ruleId);

    /**
     * 启用规则
     * @param ruleId
     * @return
     */
    int openRule(int ruleId);

    /**
     * 禁用规则
     * @param ruleId
     * @return
     */
    int closeRule(int ruleId);

    /**
     * 修改规则(弃用)
     * @param rule
     * @return
     */
    int updateRule(Rule rule);
}
